package com.vhall.component.entity.account;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


/**
 * @author dongsong
 */
@Data
@TableName("actions")
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "ActionsEntity对象", description = "操作表")
public class ActionsEntity implements Serializable {

    private static final long serialVersionUID = -6170978766982576913L;
    @TableId(value = "action_id", type = IdType.AUTO)
    @JsonProperty("action_id")
    private Integer actionId;

    @TableField("controller_name")
    @ApiModelProperty(value = "控制器名称")
    @JsonProperty("controller_name")
    private String controllerName;

    @TableField("action_name")
    @ApiModelProperty(value = "操作名称")
    @JsonProperty("action_name")
    private String actionName;

    @TableField("action_tag")
    @ApiModelProperty(value = "操作标识")
    @JsonProperty("action_tag")
    private String actionTag;

    @TableField("`desc`")
    @ApiModelProperty(value = "描述")
    private String desc;

    @TableField("pid")
    @ApiModelProperty(value = "父id")
    private Integer pid;

    @TableField("created_at")
    @ApiModelProperty(value = "创建时间")
    @JsonProperty("created_at")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    @ApiModelProperty(value = "更新时间")
    @JsonProperty("updated_at")
    private LocalDateTime updatedAt;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_at")
    @JsonProperty("deleted_at")
    private LocalDateTime deletedAt;

    @TableField(exist = false)
    private List<ActionsEntity> children;

    @TableField("type")
    @ApiModelProperty(value = "类型1-admin操作，2-控制台操作")
    private Byte type;

    @TableField("status")
    @ApiModelProperty(value = "状态:1-正常，2-禁用，-1-删除")
    private Byte status;

}
